package com.wang.myblog.service;

import com.wang.myblog.common.PageResponse;
import com.wang.myblog.common.PageResult;
import com.wang.myblog.entity.Archive;
import com.wang.myblog.entity.Article;
import com.wang.myblog.entity.Tag;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface ArticleService {

    boolean insert(Article article);

    boolean deleteById(Integer id);

    Article queryById(Integer id);

    boolean update(Article article);

    List<Article> queryByStatus(Integer status);

    boolean update(Integer id, String title, String content, List<Integer> tagIdList , Integer kindId, String introduce, Integer status,String img);

    Integer publish(String title,String content,String introduce,Integer status,String img,Integer kindId,List<Integer> tagIdList);

    PageResponse queryByPageAndStatus(Integer draw,Integer start, Integer limit, Integer status,String searchMsg);

    Integer getCountByStatus(Integer status,String searchMsg);

    boolean clearRecyleBin();

    List<Article> queryPublishedArticleOrderByPublishTime(Integer page);

    /*前台获取阅读前10文章（已发布）
     */
    List<Article> queryOrderByReadCount();

    //获取日期归档
    List<Archive> getArchive();

    //前台获取标签关联文章
    List<Article> queryPublishedArticleByTagId(Integer tagId,Integer page);

    //前台获取分类关联文章
    List<Article> queryPublishedArticleByKindId(Integer kindId,Integer page);

    //前台获取归档文章
    List<Article> queryByDate(Date date,Integer page);

    //前台通过搜索结果获取发布文章
    List<Article> queryPublishedArticleByMsg(String msg,Integer page);

    //根据指定归档获取其关联的文章数目
    Integer getPublishedArticleCountByDate(String date);

    //根据指定标签获取其关联的文章数目
    Integer getPublishedArticleCountByTagId(Integer tagId);

    //根据指定分类获取其关联的文章数目
    Integer getPublishedArticleCountByKindId(Integer kindId);

    //前台通过搜索信息获取文章的总数
    Integer getPublishedCountByMsg(String msg);



}
